﻿CREATE TABLE [dbo].[mnContactsAddress] (
    [ContactID]     INT NOT NULL,
    [AddressID]     INT NOT NULL,
    [AddressTypeID] INT NOT NULL,
    CONSTRAINT [PK_mnContactsAddress] PRIMARY KEY CLUSTERED ([ContactID] ASC, [AddressID] ASC, [AddressTypeID] ASC),
    CONSTRAINT [FK_mnContactsAddress_datAddress] FOREIGN KEY ([AddressID]) REFERENCES [dbo].[datAddress] ([AddressID]),
    CONSTRAINT [FK_mnContactsAddress_datContacts] FOREIGN KEY ([ContactID]) REFERENCES [dbo].[datContacts] ([ContactID]),
    CONSTRAINT [FK_mnContactsAddress_domAddressType] FOREIGN KEY ([AddressTypeID]) REFERENCES [dbo].[domAddressType] ([AddressTypeID])
);

